package cn.com.shaom.learning.sb;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @author Shaom
 */
@SpringBootApplication
public class SpringbootBatchApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootBatchApplication.class, args);

        // 手动启动
        /*ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        JobLauncher jobLauncher = (JobLauncher) applicationContext.getBean("jobLauncher");
		Job personJob = (Job) applicationContext.getBean("personJob");

		String sql = "insert into person (name, age, nation, address) values (:name, :age, :nation, :address)";
		JobParameters jobParameters = new JobParametersBuilder()
				.addLong("time", System.currentTimeMillis())
				.addString("input.file.name", "people.cvs")
				.addString("output.insert.sql", sql)
				.toJobParameters();

		JobExecution jobExecution = jobLauncher.run(personJob, jobParameters);
		System.out.println(jobExecution.toString());*/
    }
}
